﻿using System;
using System.Linq;


class SummedSequences
{
    static void Main()
    {
        int[] numbers = { 4, 3, 1, 4, 2, 5, 8 };
        int sum = 8; //int.Parse(Console.ReadLine());


        for (int counter = 0; counter < numbers.Length; counter++)
        {
            int tempSum = 0;

            for (int sequenceCounter = counter; sequenceCounter < numbers.Length; sequenceCounter++)
            {
                if (numbers[sequenceCounter] <= sum)
                {
                    tempSum += numbers[sequenceCounter];
                }
                else 
                {
                    break;
                }

                // print result
                if (tempSum == sum)
                {
                    for (int printCounter = sequenceCounter; sum > 0; printCounter--)
                    {
                        Console.Write("{0}, ", numbers[printCounter]);
                        sum = sum - numbers[printCounter];
                    }
                    Console.WriteLine();
                }
            }
        }
    }
}
